/**
 * futures : masterlink.futures.vo.FutcanTrid.java
 */
package masterlink.futures.vo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * TODO Write the description
 *
 * @author : tonyyang
 * Create date : 2012/3/13
 * @version 1.0.0	
 */
@Entity
public class FutcanGroup implements Serializable{

	private static final long serialVersionUID = 1226042507069615789L;
	@Id
	private ID id;
	@Column(name="coverqty")
	private Long coverqty;
	@Column(name="coverincome")
	private Double coverincome;
	@Column(name="fee")
	private Double fee;
	@Column(name="tax")
	private Double tax;
	
	/**
	 * @return the id
	 */
	public ID getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(ID id) {
		this.id = id;
	}

	/**
	 * @return the coverqty
	 */
	public Long getCoverqty() {
		return coverqty;
	}

	/**
	 * @param coverqty the coverqty to set
	 */
	public void setCoverqty(Long coverqty) {
		this.coverqty = coverqty;
	}

	/**
	 * @return the coverincome
	 */
	public Double getCoverincome() {
		return coverincome;
	}

	/**
	 * @param coverincome the coverincome to set
	 */
	public void setCoverincome(Double coverincome) {
		this.coverincome = coverincome;
	}

	/**
	 * @return the fee
	 */
	public Double getFee() {
		return fee;
	}

	/**
	 * @param fee the fee to set
	 */
	public void setFee(Double fee) {
		this.fee = fee;
	}

	/**
	 * @return the tax
	 */
	public Double getTax() {
		return tax;
	}

	/**
	 * @param tax the tax to set
	 */
	public void setTax(Double tax) {
		this.tax = tax;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("FutcanTrid [id=");
		builder.append(id);
		builder.append(", coverqty=");
		builder.append(coverqty);
		builder.append(", coverincome=");
		builder.append(coverincome);
		builder.append(", fee=");
		builder.append(fee);
		builder.append(", tax=");
		builder.append(tax);
		builder.append("]");
		return builder.toString();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof FutcanGroup))
			return false;
		FutcanGroup other = (FutcanGroup) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	@Embeddable
	public static class ID implements Serializable{

		private static final long serialVersionUID = -7924450830206602533L;
		@Column(name="trid")
		private String trid;
		@Column(name="setMonth")
		private Integer setMonth;
		@Column(name="strikePrice")
		private Double strikePrice;
		/**
		 * @return the trid
		 */
		public String getTrid() {
			return trid;
		}
		/**
		 * @param trid the trid to set
		 */
		public void setTrid(String trid) {
			this.trid = trid;
		}
		/**
		 * @return the setMonth
		 */
		public Integer getSetMonth() {
			return setMonth;
		}
		/**
		 * @param setMonth the setMonth to set
		 */
		public void setSetMonth(Integer setMonth) {
			this.setMonth = setMonth;
		}
		/**
		 * @return the strikePrice
		 */
		public Double getStrikePrice() {
			return strikePrice;
		}
		/**
		 * @param strikePrice the strikePrice to set
		 */
		public void setStrikePrice(Double strikePrice) {
			this.strikePrice = strikePrice;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#toString()
		 */
		@Override
		public String toString() {
			StringBuilder builder = new StringBuilder();
			builder.append("ID [trid=");
			builder.append(trid);
			builder.append(", setMonth=");
			builder.append(setMonth);
			builder.append(", strikePrice=");
			builder.append(strikePrice);
			builder.append("]");
			return builder.toString();
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#hashCode()
		 */
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result
					+ ((setMonth == null) ? 0 : setMonth.hashCode());
			result = prime * result
					+ ((strikePrice == null) ? 0 : strikePrice.hashCode());
			result = prime * result + ((trid == null) ? 0 : trid.hashCode());
			return result;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#equals(java.lang.Object)
		 */
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (!(obj instanceof ID))
				return false;
			ID other = (ID) obj;
			if (setMonth == null) {
				if (other.setMonth != null)
					return false;
			} else if (!setMonth.equals(other.setMonth))
				return false;
			if (strikePrice == null) {
				if (other.strikePrice != null)
					return false;
			} else if (!strikePrice.equals(other.strikePrice))
				return false;
			if (trid == null) {
				if (other.trid != null)
					return false;
			} else if (!trid.equals(other.trid))
				return false;
			return true;
		}
		
	}

}
